/**
   A class to convert degree, minute, seconds to decimal degrees
*/
public class Degrees
{
   /**
      Converts minutes and seconds to decimal degrees 
      @param degrees the degrees between -359 and 359
      @param minutes the minutes between 0 and 59
      @param seconds the minutes between 0 and 59
      @return the equivalent decimal degrees between -360 and 360 (exclusive)
   */
   public double decimalDegrees(int degrees, int minutes, int seconds)
   {
      if(degrees<0)
      {
         double decimalDegrees=(double)degrees-1+(double)minutes/60+(double)seconds/3600;
         return  decimalDegrees;
         
      }
      else {
          double decimalDegrees=(double)degrees+(double)minutes/60+(double)seconds/3600;
          return  decimalDegrees;
      }
   }
}